import { http } from '@/utils/http'
import type { BannerItem, CategoryItem, HotItem, GuessItem } from '@/types/home'
import type { PageResult, PageParams } from '@/types/global'
//首页获取轮播图
export const getHomeBannerAPI = (distributionSite = 1) => {
  return http<BannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      distributionSite,
    },
  })
}
// 获取分类信息
export const getHomeCategoryAPI = () => {
  return http<CategoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
  })
}
//获取特惠推荐
export const getHomeHotAPI = () => {
  return http<HotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
  })
}
/**
 * 获取猜你喜欢的数据
 */
export const getGoodsGuessLikeAPI = (data: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: `/home/goods/guessLike?page=${data?.page}&pageSize=${data?.pageSize}`,
  })
}
